package com.qf.lanzhou.blog.api.service.impl;

import com.qf.lanzhou.blog.api.dao.ArticlePaginationDao;
import com.qf.lanzhou.blog.api.dao.Impl.ArticlePaginationDaolmpl;
import com.qf.lanzhou.blog.api.pojo.entity.Page;
import com.qf.lanzhou.blog.api.service.ArticlePaginationService;

import java.util.List;

/**
 * @author jack
 */
public class ArticlePaginationServicelmpl implements ArticlePaginationService {
    private ArticlePaginationDao apd = new ArticlePaginationDaolmpl();
    @Override
    public List Pagination(Integer i) {
        Page page = new Page(i,20);
        List list = apd.defaultPagination(page);
        return list;
    }

    @Override
    public Integer getTotalCounts() {
        Long aLong = apd.selectCount();
        String s = Long.toString(aLong);
        Integer i = Integer.decode(s);
        return i;
    }

    @Override
    public List kudosPagination(Integer i) {
        Page page = new Page(i,20);
        List list = apd.kudosPagination(page);
        return list;
    }
}
